/**
 * Copyright (c) 2015-2016, Michael Yang 杨福海 (fuhai999@gmail.com).
 *
 * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.gnu.org/licenses/lgpl-3.0.txt
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.wzgl.core.baseModel;

import java.util.Date;

import com.jfinal.plugin.activerecord.IBean;
import com.jfinal.plugin.ehcache.CacheKit;
import com.jfinal.plugin.ehcache.IDataLoader;
import com.wzgl.core.base.JModel;
import com.wzgl.message.MessageKit;

/**
 *  Auto generated by JPress, do not modify this file.
 */
@SuppressWarnings("serial")
public abstract class BaseTrelease<M extends BaseTrelease<M>> extends JModel<M> implements IBean {

	public static final String CACHE_NAME = "trelease";
	public static final String METADATA_TYPE = "trelease";

	public static final String ACTION_ADD = "trelease:add";
	public static final String ACTION_DELETE = "trelease:delete";
	public static final String ACTION_UPDATE = "trelease:update";
	
	public void removeCache(Object key){
		if(key == null) return;
		CacheKit.remove(CACHE_NAME, key);
	}

	public void putCache(Object key,Object value){
		CacheKit.put(CACHE_NAME, key, value);
	}

	public M getCache(Object key){
		return CacheKit.get(CACHE_NAME, key);
	}

	public M getCache(Object key,IDataLoader dataloader){
		return CacheKit.get(CACHE_NAME, key, dataloader);
	}



	@Override
	public boolean equals(Object o) {
		if(o == null){ return false; }
		if(!(o instanceof BaseTrelease<?>)){return false;}

		BaseTrelease<?> m = (BaseTrelease<?>) o;
		if(m.getFid() == null){return false;}

		return m.getFid().compareTo(this.getFid()) == 0;
	}

	@Override
	public boolean save() {
		boolean saved = super.save();
		if (saved) { MessageKit.sendMessage(ACTION_ADD, this); }
		return saved;
	}

	@Override
	public boolean delete() {
		boolean deleted = super.delete();
		if (deleted) { MessageKit.sendMessage(ACTION_DELETE, this); }
		return deleted;
	}

	@Override
	public boolean deleteById(Object idValue) {
		boolean deleted = super.deleteById(idValue);
		if (deleted) { MessageKit.sendMessage(ACTION_DELETE, this); }
		return deleted;
	}

	@Override
	public boolean update() {
		boolean update = super.update();
		if (update) { MessageKit.sendMessage(ACTION_UPDATE, this); }
		return update;
	}

	public void setFid(java.lang.String id) {
		set("fid", id);
	}

	public java.lang.String getFid() {
		Object id = get("fid");
		if (id == null)
			return null;
		return id.toString();
	}

	public void setFtoken(String ftoken){
		set("ftoken",ftoken);
	}
	public String getFtoken(){
		return get("ftoken");
	}
	
	public void setFappId(String fappId){
		set("fappId",fappId);
	}
	public String getFappId(){
		return get("fappId");
	}
	
	public void setFappSecret(String fappSecret){
		set("fappSecret",fappSecret);
	}
	public String getFappSecret(){
		return get("fappSecret");
	}
	
	public void setFaccount(String faccount){
		set("faccount",faccount);
	}
	public String getFaccount(){
		return get("faccount");
	}
	
	public void setFpass(String fpass){
		set("fpass",fpass);
	}
	public String getFpass(){
		return get("fpassx");
	}
	
	public void setFctime(Date fctime){
		set("fctime",fctime);
	}
	public String getFctime(){
		return get("fctime");
	}
	
	public void setFetime(Date fetime){
		set("fetime",fetime);
	}
	public Date getFetime(){
		return get("fetime");
	}
	
	public void setFtype(String ftype){
		set("ftype",ftype);
	}
	public String getFtype(){
		return get("ftype");
	}
	
	public void setFtimer(String ftimer){
		set("ftimer",ftimer);
	}
	public String getFtimer(){
		return get("ftimer");
	}
	
	public void setFxz(String fxz){
		set("fxz",fxz);
	}
	public String getFxz(){
		return get("fxz");
	}
	
	public void setFxzm(String fxzm){
		set("fxzm",fxzm);
	}
	public String getFxzm(){
		return get("fxzm");
	}
	
	public void setFstatus(Integer fstatus){
		set("fstatus",fstatus);
	}
	public Integer getFstatus(){
		return get("fstatus");
	}
	
	public void setFecount(Integer fecount){
		set("fecount",fecount);
	}
	public Integer getFecount(){
		return get("fecount");
	}
	
	public void setFremark(java.lang.String fremark) {
		set("fremark", fremark);
	}
	public java.lang.String getFremark() {
		return get("fremark");
	}
	
	public void setFdesc(java.lang.String fdesc) {
		set("fdesc", fdesc);
	}
	public java.lang.String getFdesc() {
		return get("fdesc");
	}
}
